home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _D5E34169D3B14982A2DA7FF25D283ED2 < prev    next >
Encoding:
Text File  |  2004-01-06  |  10.2 KB  |  457 lines

  1. function DefOnMouseEnter(self)
  2.     self:SetBorderColor(UI.szFocusColor);
  3. end
  4.  
  5. function DefOnMouseLeave(self)
  6.     local Focus = UI:GetFocus();
  7.     
  8.     if (Focus) then
  9.         if (Focus:GetName() == self:GetName()) then
  10.             local ScreenF = Focus:GetScreen();
  11.             local ScreenS = self:GetScreen();
  12.  
  13.             if (ScreenF:GetName() == ScreenS:GetName()) then
  14.                 return
  15.             end
  16.         end
  17.     end
  18.  
  19.     self:SetBorderColor(UI.szBorderColor);
  20. end
  21.  
  22. function DefOnGotFocus(self)
  23.     self:SetBorderColor(UI.szFocusColor);
  24. end
  25.  
  26. function DefOnLostFocus(self)
  27.     self:SetBorderColor(UI.szBorderColor);
  28. end
  29.  
  30. function DefOnMouseEnterSideButton(self)
  31.     self:SetFontColor(UI.szFocusColor);
  32. end
  33.  
  34. function DefOnGotFocusButton(self)
  35.     self:SetOverState(1);
  36. end
  37.  
  38. function DefOnLostFocusButton(self)
  39.     self:SetOverState(0);
  40. end
  41.  
  42. function DefOnMouseLeaveSideButton(self)
  43.     local Focus = UI:GetFocus();
  44.     
  45.     if (Focus) then
  46.         if (Focus:GetName() == self:GetName()) then
  47.             local ScreenF = Focus:GetScreen();
  48.             local ScreenS = self:GetScreen();
  49.  
  50.             if (ScreenF:GetName() == ScreenS:GetName()) then
  51.                 return
  52.             end
  53.         end
  54.     end
  55.  
  56.     self:SetFontColor("113 142 122 255");
  57. end
  58.     
  59. function DefOnGotFocusSideButton(self)
  60.     self:SetFontColor(UI.szFocusColor);
  61. end
  62.  
  63. function DefOnLostFocusSideButton(self)
  64.     self:SetFontColor("113 142 122 255");
  65. end
  66.  
  67.  
  68. UI.skins=
  69. {    
  70.     MenuStatic=                            -- e.g. time counting down
  71.     {
  72.         classname = "static",
  73.         width = 180, height = 28,
  74.         
  75.         color = "0 0 0 255",
  76.         
  77.         leftspacing = 6,
  78.         
  79.         bordersize = 1,
  80.         bordercolor = UI.szBorderColor,
  81.     },
  82.     
  83.     MenuBorder=                            -- e.g. borders to show grouping
  84.     {
  85.         classname = "static",
  86.         width = 180, height = 28,
  87.         
  88.         color = "0 0 0 0",
  89.         
  90.         leftspacing = 6,
  91.         
  92.         bordersize = 1,
  93.         bordercolor = UI.szBorderColor,
  94.     },
  95.     
  96.     TopMenuButton=
  97.     {
  98.         classname = "button",
  99.         left = 200, top = 110,
  100.         width = 180, height = 24.5,
  101.         bordersides="lr",
  102.                 
  103.         texture = System:LoadImage("textures/gui/buttons.dss"),
  104.         downtexture = System:LoadImage("textures/gui/buttons_down.dss"),
  105.         overtexture = System:LoadImage("textures/gui/buttons_over.dss"),
  106.         texrect = "0 0 1 1",
  107.         
  108.         color = "255 255 255 255",
  109.                 
  110.         bordersize = 1,
  111.         bordercolor = UI.szBorderColor,
  112.         
  113.         fontsize = 18,
  114.         
  115.         OnGotFocus = DefOnGotFocusButton,
  116.         OnLostFocus = DefOnLostFocusButton,    
  117.     },
  118.  
  119.     BottomMenuButton=
  120.     {
  121.         classname = "button",
  122.         left = 200, top = 464.5,
  123.         width = 180, height = 25,
  124.         bordersides="lr",
  125.         
  126.         texture = System:LoadImage("textures/gui/buttons.dss"),
  127.         downtexture = System:LoadImage("textures/gui/buttons_down.dss"),
  128.         overtexture = System:LoadImage("textures/gui/buttons_over.dss"),
  129.         texrect = "0 0 1 1",    
  130.         
  131.         color = "255 255 255 255",
  132.         
  133.         bordersize = 1,
  134.         bordercolor = UI.szBorderColor,
  135.                 
  136.         fontsize = 18,
  137.         
  138.         OnGotFocus = DefOnGotFocusButton,
  139.         OnLostFocus = DefOnLostFocusButton,    
  140.     },
  141.  
  142.     SideMenuButton=
  143.     {
  144.         classname = "button",
  145.         width = 110, height = 32,
  146.         style = UISTYLE_TRANSPARENT,
  147.         
  148.         fontcolor = "113 142 122 255",
  149.         
  150.         fontsize = 20,
  151.         halign = UIALIGN_LEFT,
  152.         
  153.         OnGotFocus = DefOnGotFocusSideButton,
  154.         OnLostFocus = DefOnLostFocusSideButton,    
  155.         OnMouseEnter = DefOnMouseEnterSideButton,
  156.         OnMouseLeave = DefOnMouseLeaveSideButton,
  157.     },
  158.  
  159.     MenuHeader=
  160.     {
  161.         classname = "static",
  162.         left = 0, top = 0,
  163.         width = 800, height = 100,
  164.  
  165.         bordersize = 0,
  166.         bordercolor = "0 0 0 255",    
  167.         
  168.         color = "0 0 0 0",
  169.     },
  170.  
  171.     MenuFooter=
  172.     {
  173.         classname = "static",
  174.         left = 0, top = 600 - 100,
  175.         width = 800, height = 100,
  176.         
  177.         bordersize = 0,
  178.                 
  179.         texture = System:LoadImage("Textures/gui/menubottom"),
  180.         texrect = "0, 0, 1024, 128",
  181.     },
  182.  
  183.     MenuLeft=
  184.     {
  185.         classname = "static",
  186.         left = 0, top = 100,
  187.         width = 50, height = 500,
  188.         
  189.         bordersize = 0,
  190.                 
  191.         texture = System:LoadImage("Textures/gui/menuleft"),
  192.         texrect = "0, 0, 64, 512",
  193.     },
  194.  
  195.     MenuRight=
  196.     {
  197.         classname = "static",
  198.         left = 700, top = 100,
  199.         width = 100, height = 100,
  200.         
  201.         bordersize = 0,
  202.         flags = UIFLAG_VISIBLE,
  203.         greyedcolor = "0 0 0 0",
  204.                 
  205.         texture = System:LoadImage("Textures/gui/menuright"),
  206.         texrect = "0, 0, 128, 128",
  207.     },
  208.  
  209.     FooterAd=
  210.     {
  211.         classname = "static",
  212.         
  213.         color = "255 255 255 255",
  214.         
  215.         bordersize = 0,
  216.     },
  217.     
  218.     MenuHeader=
  219.     {
  220.         classname = "static",
  221.         left = 0, top = 0,
  222.         width = 800, height = 100,
  223.         color = "255 255 255 255",
  224.         bordersize = 0,
  225.         
  226.         texture = System:LoadImage("Textures/gui/menutop1"),
  227.         texrect = "0, 0, 1024, 128",
  228.     },
  229.     
  230.     BackStatic=
  231.     {
  232.         classname = "static",
  233.         left = 200, top = 110,
  234.         width = 580, height = 380,
  235.         
  236.         color = "0 0 0 96",
  237.         bordersize = 1,
  238.         bordercolor = UI.szBorderColor,
  239.     },
  240.     
  241.     ComboBox=
  242.     {
  243.         classname = "combobox",
  244.         width = 166, height = 28,
  245.  
  246.         bordersize = 1,
  247.         bordercolor = UI.szBorderColor,
  248.         
  249.         buttontexture = System:LoadImage("textures/gui/buttons.dds"),
  250.         downbuttontexture = System:LoadImage("textures/gui/buttons_down.dds"),
  251.         overbuttontexture = System:LoadImage("textures/gui/buttons_over.dds"),
  252.         buttontexrect = "2 3 25 25",
  253.         
  254.         itembgcolor = "0 0 0 255",
  255.         
  256.         leftspacing = 6,
  257.         buttonsize = 28,
  258.  
  259.         OnGotFocus = DefOnGotFocus,
  260.         OnLostFocus = DefOnLostFocus,
  261.         OnMouseEnter = DefOnMouseEnter,
  262.         OnMouseLeave = DefOnMouseLeave,        
  263.     },
  264.  
  265.     EditBox=
  266.     {
  267.         classname = "editbox",
  268.         width = 166, height = 28,
  269.  
  270.         bordersize = 1,
  271.         bordercolor = UI.szBorderColor,
  272.         
  273. --        style = UISTYLE_TRANSPARENT,
  274.         
  275.         leftspacing = 4,
  276.         rightspacing = 4,
  277.         
  278.         cursorcolor = "255 255 255 255",
  279.         selectioncolor = UI.szSelectionColor,
  280.         color="0 0 0 255",
  281.                 
  282.         OnGotFocus = DefOnGotFocus,
  283.         OnLostFocus = DefOnLostFocus,
  284.         OnMouseEnter = DefOnMouseEnter,
  285.         OnMouseLeave = DefOnMouseLeave,
  286.     },
  287.  
  288.     ListView=
  289.     {
  290.         classname = "listview",
  291.         width = 680, height = 480,
  292.         bordersize = 1,
  293.         bordercolor = UI.szBorderColor,
  294.         color="0 0 0 0",
  295.         headerheight = 22,
  296.         cellpadding = 4,
  297.     
  298.         selectioncolor = UI.szSelectionColor,
  299.         
  300.         OnGotFocus = DefOnGotFocus,
  301.         OnLostFocus = DefOnLostFocus,
  302.         OnMouseEnter = DefOnMouseEnter,
  303.         OnMouseLeave = DefOnMouseLeave,
  304.     },
  305.     
  306.     CheckBox=
  307.     {
  308.         classname = "checkbox",
  309.         width = 28, height = 28,
  310. --        color="255 255 255 255",
  311.         color="0 0 0 255",
  312.                 
  313.         bordersize = 1,
  314.         bordercolor = UI.szBorderColor,
  315.         
  316.         checkcolor = "121 186 128 255",
  317.         
  318. --        style = UISTYLE_TRANSPARENT,
  319.         
  320.         OnGotFocus = DefOnGotFocus,
  321.         OnLostFocus = DefOnLostFocus,
  322.         OnMouseEnter = DefOnMouseEnter,
  323.         OnMouseLeave = DefOnMouseLeave,        
  324.     },
  325.     
  326.     Label=
  327.     {
  328.         classname = "static",
  329.         style = UISTYLE_TRANSPARENT,
  330.         halign = UIALIGN_RIGHT,
  331.         height = 28,
  332.         
  333.         leftspacing = 6,
  334.     },
  335.  
  336.     VScrollBar=
  337.     {
  338.         classname = "scrollbar",
  339.         color = "255 255 255 255",
  340.         
  341.         bordersize = 1,
  342.         bordercolor = UI.szBorderColor,
  343.         
  344.         pathtexture = System:LoadImage("textures/gui/buttons.dds"),
  345.         downpathtexture = System:LoadImage("textures/gui/buttons_down.dds"),
  346.         overpathtexture = System:LoadImage("textures/gui/buttons_over.dds"),
  347.         pathtexrect = "2 2 1 1",
  348.         slidertexture = System:LoadImage("textures/gui/buttons.dds"),
  349.         downslidertexture = System:LoadImage("textures/gui/buttons_down.dds"),
  350.         overslidertexture = System:LoadImage("textures/gui/buttons_over.dds"),
  351.         slidertexrect = "59 30 24 27",
  352.         minustexture = System:LoadImage("textures/gui/buttons.dds"),
  353.         downminustexture = System:LoadImage("textures/gui/buttons_down.dds"),
  354.         overminustexture = System:LoadImage("textures/gui/buttons_over.dds"),
  355.         minustexrect = "31 3 24 24",
  356.         plustexture = System:LoadImage("textures/gui/buttons.dds"),
  357.         downplustexture = System:LoadImage("textures/gui/buttons_down.dds"),
  358.         overplustexture = System:LoadImage("textures/gui/buttons_over.dds"),    
  359.         plustexrect = "3 3 24 24",
  360.         
  361.         width = 20, height = 200,
  362.         
  363.         OnGotFocus = DefOnGotFocus,
  364.         OnLostFocus = DefOnLostFocus,
  365.         OnMouseEnter = DefOnMouseEnter,
  366.         OnMouseLeave = DefOnMouseLeave,        
  367.     },
  368.  
  369.     HScrollBar=
  370.     {
  371.         classname = "scrollbar",
  372.         color = "255 255 255 255",
  373.         
  374.         bordersize = 1,
  375.         bordercolor = UI.szBorderColor,
  376.         
  377.         pathtexture = System:LoadImage("textures/gui/buttons.dds"),
  378.         downpathtexture = System:LoadImage("textures/gui/buttons_down.dds"),
  379.         overpathtexture = System:LoadImage("textures/gui/buttons_over.dds"),
  380.         pathtexrect = "2 2 1 1",    
  381.         slidertexture = System:LoadImage("textures/gui/buttons.dds"),
  382.         downslidertexture = System:LoadImage("textures/gui/buttons_down.dds"),
  383.         overslidertexture = System:LoadImage("textures/gui/buttons_over.dds"),
  384.         slidertexrect = "58 31 27 24",
  385.         minustexture = System:LoadImage("textures/gui/buttons.dds"),
  386.         downminustexture = System:LoadImage("textures/gui/buttons_down.dds"),
  387.         overminustexture = System:LoadImage("textures/gui/buttons_over.dds"),
  388.         minustexrect = "3 31 24 24",
  389.         plustexture = System:LoadImage("textures/gui/buttons.dds"),
  390.         downplustexture = System:LoadImage("textures/gui/buttons_down.dds"),
  391.         overplustexture = System:LoadImage("textures/gui/buttons_over.dds"),    
  392.         plustexrect = "31 31 24 24",
  393.         
  394.         width = 200, height = 20,
  395.  
  396.         OnGotFocus = DefOnGotFocus,
  397.         OnLostFocus = DefOnLostFocus,
  398.         OnMouseEnter = DefOnMouseEnter,
  399.         OnMouseLeave = DefOnMouseLeave,        
  400.     },
  401.  
  402.     ChatBox=
  403.     {
  404.         classname = "static",
  405.         style = UISTYLE_MULTILINE + UISTYLE_WORDWRAP,
  406.         color = "0 0 0 0",
  407.         
  408.         valign = UIALIGN_BOTTOM,
  409.         
  410.         bordersize = 1,
  411.         bordercolor = UI.szBorderColor,
  412.     },
  413.     
  414.     ChatTarget=
  415.     {
  416.         classname = "combobox",
  417.         width = 126, height = 26,
  418.  
  419.         color = "255, 255, 255, 255",        
  420.         rollup = 1,
  421.         
  422.         bordersize = 1,
  423.         bordercolor = UI.szBorderColor,
  424.         
  425.         buttontexture = System:LoadImage("textures/gui/buttons.dds"),
  426.         downbuttontexture = System:LoadImage("textures/gui/buttons_down.dds"),
  427.         overbuttontexture = System:LoadImage("textures/gui/buttons_over.dds"),
  428.         buttontexrect = "2 3 25 25",
  429.         
  430.         itembgcolor = "0 0 0 255",
  431.         
  432.         leftspacing = 4,
  433.         buttonsize = 22,
  434.         
  435.         OnGotFocus = DefOnGotFocus,
  436.         OnLostFocus = DefOnLostFocus,
  437.         OnMouseEnter = DefOnMouseEnter,
  438.         OnMouseLeave = DefOnMouseLeave,            
  439.     },
  440.     
  441.     ChatInput=
  442.     {
  443.         classname = "editbox",
  444.         width = 440, height = 24,
  445.         
  446.         color = "0 0 0 64",
  447.         
  448.         bordersize = 1,
  449.         bordercolor = UI.szBorderColor,
  450.         cursorcolor = "255 255 255 255",    
  451.     
  452.         OnGotFocus = DefOnGotFocus,
  453.         OnLostFocus = DefOnLostFocus,
  454.         OnMouseEnter = DefOnMouseEnter,
  455.         OnMouseLeave = DefOnMouseLeave,            
  456.     }
  457. };